package kaoshi;

import java.util.Scanner;

public class Demo {
	public static void main(String[] args) {
	new Student().sum();
	
	}
}
class Student {
	private String id;
	private String name;
	private double englishScore;
	private double mathScore;
	private double computerScore;
	private double sumScore;
	public Student() {
	}
	public Student(String id, String name, double englishScore,
			double mathScore, double computerScore, double sumScore) {
		super();
		this.id = id;
		this.name = name;
		this.englishScore = englishScore;
		this.mathScore = mathScore;
		this.computerScore = computerScore;
		this.sumScore = sumScore;
	}
	public String getId() {
		return id;
	}
	public void setId(String id) {
		this.id = id;
	}
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	public double getEnglishScore() {
		return englishScore;
	}
	public void setEnglishScore(double englishScore) {
		this.englishScore = englishScore;
	}
	public double getMathScore() {
		return mathScore;
	}
	public void setMathScore(double mathScore) {
		this.mathScore = mathScore;
	}
	public double getComputerScore() {
		return computerScore;
	}
	public void setComputerScore(double computerScore) {
		this.computerScore = computerScore;
	}
	public double getSumScore() {
		return sumScore;
	}
	public void setSumScore(double sumScore) {
		this.sumScore = sumScore;
	}
	public String toString() {
		return "Student [id=" + id + ", name=" + name + ", englishScore="
				+ englishScore + ", mathScore=" + mathScore
				+ ", computerScore=" + computerScore + ", sumScore=" + sumScore
				+ "]";
	}
	
	public void equals(){
		System.out.println("请分别输入两个学生的总成绩：");
		Scanner s=new Scanner(System.in);
		double a=s.nextDouble();
		double b=s.nextDouble();
		if(a==b){
			System.out.println("两个学生成绩相同！");
		}else{
			System.out.println("两个学生成绩不同！");
		}
	}
	public void compare(){
		System.out.println("请分别输入两个学生的总成绩：");
		Scanner s=new Scanner(System.in);
		double a=s.nextDouble();
		double b=s.nextDouble();
		if(a==b){
			System.out.println("两个学生成绩相同！");
		}else if(a>b){
			System.out.println("前者总分高！");
		}else{
			System.out.println("后者总分高！");
		}
		
	}
	/*	属性包括：学号，姓名，英语成绩，数学成绩，计算机成绩和总成绩
	方法包括：构造方法，get方法，set方法，toString()方法，equals方法，
	compare方法（比较两个学生的总成绩，结果分大于，小于，等于），
	sum方法（计算总成绩）和testScore()方法（计算评测成绩）。*/
	public void sum(){
		System.out.println("请分别输入学生的各科成绩：");
		Scanner s=new Scanner(System.in);
		double a=s.nextDouble();
		double b=s.nextDouble();
		double c=s.nextDouble();
		double sum=a+b+c;
		System.out.println("总成绩为："+sum);
	}
	public void testScore(){
		System.out.println("请分别输入学生的各科成绩：");
		Scanner s=new Scanner(System.in);
		double a=s.nextDouble();
		double b=s.nextDouble();
		double c=s.nextDouble();
		double num=(a+b+c)/3;
		System.out.println("总成绩为："+num);
	}
	
	
}